libglnx porting: Migrate to glnx_stream_fstat()
authorColin Walters <walters@verbum.org>
Tue, 3 May 2016 21:24:25 +0000 (17:24 -0400)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Fri, 6 May 2016 14:29:59 +0000 (14:29 +0000)
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.

Closes: #282
Approved by: jlebon

libglnx
src/libostree/ostree-core.c
src/libostree/ostree-fetcher.c
src/libostree/ostree-repo.c

diff --git a/libglnx b/libglnx
index 47ddbfa56341df3a9453854e1101e1c2f2359ddb..3d162e772db80f6664a78583268150d2e1d1d29e 160000 (submodule)
--- a/libglnx
+++ b/libglnx
@@ -1 +1 @@
-Subproject commit 47ddbfa56341df3a9453854e1101e1c2f2359ddb
+Subproject commit 3d162e772db80f6664a78583268150d2e1d1d29e
index ded5e9769c21bd370d43e16b41010bcc886b0d35..55ff4d63fe7b838b03694bdb6af61c438612cae8 100644 (file)
@@ -613,7 +613,7 @@ ostree_content_file_parse_at (gboolean                compressed,
                               cancellable, error))
     goto out;
       
-  if (!gs_stream_fstat ((GFileDescriptorBased*)file_input, &stbuf, cancellable, error))
+  if (!glnx_stream_fstat ((GFileDescriptorBased*)file_input, &stbuf, error))
     goto out;
   
   if (!ostree_content_stream_parse (compressed, file_input, stbuf.st_size, trusted,
index 3606e8fbe5534734da7a3bf03b6e82ac88d1d571..6a75ad5987f891eb5a103d73704c3d1a986a6bd2 100644 (file)
@@ -1067,7 +1067,7 @@ _ostree_fetcher_bytes_transferred (OstreeFetcher       *self)
       
       if (G_IS_FILE_DESCRIPTOR_BASED (stream))
         {
-          if (gs_stream_fstat ((GFileDescriptorBased*)stream, &stbuf, NULL, NULL))
+          if (glnx_stream_fstat ((GFileDescriptorBased*)stream, &stbuf, NULL))
             ret += stbuf.st_size;
         }
     }
index 15452c430675b1ed7a534b39f78051c78d481c2d..c395b1dca69639801e2d9464639b0e1e1a459e3a 100644 (file)
@@ -2925,7 +2925,7 @@ load_metadata_internal (OstreeRepo       *self,
             {
               struct stat stbuf;
 
-              if (!gs_stream_fstat ((GFileDescriptorBased*)ret_stream, &stbuf, cancellable, error))
+              if (!glnx_stream_fstat ((GFileDescriptorBased*)ret_stream, &stbuf, error))
                 goto out;
               *out_size = stbuf.st_size;
             }
@@ -3100,8 +3100,8 @@ ostree_repo_load_file (OstreeRepo         *self,
           tmp_stream = g_unix_input_stream_new (fd, TRUE);
           fd = -1; /* Transfer ownership */
           
-          if (!gs_stream_fstat ((GFileDescriptorBased*) tmp_stream, &stbuf,
-                                cancellable, error))
+          if (!glnx_stream_fstat ((GFileDescriptorBased*) tmp_stream, &stbuf,
+                                  error))
             goto out;
           
           if (!ostree_content_stream_parse (TRUE, tmp_stream, stbuf.st_size, TRUE,